//
//  HJFlutterManager.h
//  KaiChat
//
//  Created by lx on 2024/3/21.
//

#import <Foundation/Foundation.h>


#if LOADFLUTTER

@import Flutter;
@import FlutterPluginRegistrant;

#endif

NS_ASSUME_NONNULL_BEGIN

@class HJFlutterController;

typedef NSString * HJFlutterPageName;

static HJFlutterPageName HJFlutterPageDApp = @"dapp";
static HJFlutterPageName HJFlutterPageWallet = @"wallet";
static HJFlutterPageName HJFlutterPageIntegral = @"integral";
static HJFlutterPageName HJFlutterPageFans = @"fans";
static HJFlutterPageName HJFlutterPageFollow = @"follow";
static HJFlutterPageName HJFlutterPageNews = @"news";
static HJFlutterPageName HJFlutterPageNewsComment = @"comment";
static HJFlutterPageName HJFlutterPageBrowser = @"browser";


@interface HJFlutterManager : NSObject

@property (nonatomic, class, readonly, nonnull) HJFlutterManager *sharedManager;
@property (nonatomic, strong, readonly) NSString *channelName;
@property (nonatomic, strong, readonly) NSString *mainEngineName;
@property (nonatomic, strong) UIViewController *containController;
@property (nonatomic, weak) HJFlutterController *mainEngineController;

#if LOADFLUTTER
@property (nonatomic, strong, readonly) FlutterEngine *mainEngine;
#endif

- (void)invokeMethod:(NSString*)method arguments:(id _Nullable)arguments result:(void (^__nullable)(id _Nullable result))result;
- (NSString *)getFlutterMessageWithPage:(NSString *)page arguments:(id)arguments;
- (void)getWalletInfoComplete:(void (^)(NSDictionary *walletInfo))complete;

- (void)preloadWalletEngine;

@end

NS_ASSUME_NONNULL_END
